<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			class Animal{
				constructor(name,age)
				{
					this.name=name;
					this.age=age;
				}
				selfjieshao()
				{
					return this.name+","+this.age;
				}
			}
			 
			class Dog extends Animal{
				constructor(name,age)
				{
					super(name,age); 
				}
				catchMouse(){
					alert(this.name+"抓了一只耗子，好厉害");
				}
			}
			
			var d=new Dog("大黄",5);
			var r=d.selfjieshao();
			alert(r);
			d.catchMouse();
			//d.catchMouse();
			//alert(d);
			
		</script>
	</head>
	<body>
	</body>
</html>
